package com.ztools.okretrofit;

import android.content.Context;


import com.blankj.utilcode.util.Utils;
import com.ztools.BaseApplication;

import java.lang.ref.WeakReference;

import okhttp3.OkHttpClient;
import retrofit2.Retrofit;

/**
 * Created by zhangxuehui on 2018/2/8.
 */

public class OkRetrofit {
    private static OkRetrofit INSTANCE = null;
    private OkHttpClient mOkHttpClient;//配置OkHttpClient
    private Retrofit mRetrofit;//配置OkHttpClient
    private static WeakReference<Context> mContext;
    protected static String baseUrl = ((BaseApplication)Utils.getApp()).getUrl();
    /*设置 网络请求的超时时间*/
    public static final int connectTimeout = 10;
    public static final int writeTimeout = 10;
    public static final int readTimeout = 30;

    public static OkRetrofit getInstance() {
        if (INSTANCE == null) {
            synchronized (OkRetrofit.class) {
                if (INSTANCE == null) {
                    synchronized (OkRetrofit.class) {
                        INSTANCE = new OkRetrofit();
                    }
                }
            }
        }
        return INSTANCE;
    }



}
